<template>
  <a-button type="link" @click="doDownload" title="点击下载">
    <span class="underline">{{fileName}}.{{extName}}</span>
  </a-button>
</template>

<script>
import { defineComponent} from 'vue'
import { onMounted } from '../../../docs/.vitepress/cache/deps/vue.js'
import { doDownload } from '../../utils/common.js'

export default defineComponent({
  name: 'DownloadBtnUrl',
  props: {
    url: { type: String, default: '' },
    fileName: { type: String, default: ''},
    extName: { type: String, default: ''},
  },
  setup(props, { emit }) {

    onMounted(() => {
      console.log('output-> props.fileName::: ', props.fileName)
    })

    return {
      doDownload: () => doDownload(props.url, props.fileName, props.extName)
    }
  }
})
</script>

<style lang="less" scoped>
.underline {
  text-decoration: underline;
}
</style>
